<template>
  <div>
      <table align="center" width="600px">
          <tr>
              <td>id</td>
              <td>小说名</td>
              <td>内容</td>
              <td>操作</td>
          </tr>
          <tr v-for="i in flist" :key="i.id">
              <td>{{i.id}}</td>
              <td>{{i.title}}</td>
              <td>{{i.content}}</td>
              <td>
                  <van-button @click="fun(i.id)">审批</van-button>
              </td>
          </tr>
      </table>
      <el-dialog
        title="提示"
        :visible.sync="dialogVisible"
        width="30%"
        >
        <el-radio-group v-model="radio">
            <el-radio :label="1">通过</el-radio>
            <el-radio :label="2">不通过</el-radio>
        </el-radio-group>
        <el-button type="primary" @click="add">确 定</el-button>
        
        </el-dialog>
  </div>
</template>

<script>
export default {
    name:'check',
    data(){
        return{
            flist:[],
            dialogVisible:false,
            fid:0,
            radio:1,
            uid:localStorage.getItem('uid')
        }
    },
    methods:{
        getf(){
            this.axios.get('/issue_fiction').then(res=>{
                console.log(res);
                this.flist = res.data.list
            })
        },
        fun(fid){
            this.dialogVisible = true
            this.fid = fid
        },
        add(){
            this.dialogVisible = false
            this.axios.post('/check_fiction',{'fid':this.fid,'status':this.radio,'uid':this.uid}).then(res=>{
                console.log(res);
            })
        }
        
    },
    mounted(){
        this.getf()
    }
}
</script>

<style>

</style>